LOS ANGELES — A man who had an affair with Anna Nicole Smith in the last year of her life testified Tuesday that she became groggy when she took medications, some of which were given to her by a defendant in the drug conspiracy case.

G. Ben Thompson, a South Carolina developer, said he began a romantic relationship with the former Playboy model when she visited his Myrtle Beach home in the summer of 2005. He said she stayed in his room while Howard K. Stern, her lawyer and sometimes boyfriend, stayed in the guest room.

Thompson remembered seeing Stern bring Smith pills twice. After she swallowed them, her behavior changed, he said.

“She would become all groggy and like in la-la land,” Thompson said. “She didn’t have all her faculties.”

Stern, Dr. Khristine Eroshevich and Dr. Sandeep Kapoor have pleaded not guilty to conspiring to provide Smith with massive doses of opiates and sedatives. They are not accused of causing her 2007 overdose death.

Under questioning by Deputy District Attorney David Barkhurst, Thompson said Smith would slur her speech after taking the pills.

Thompson said he could not remember if Stern actually put the pills in her mouth.

Thompson also testified he saw Smith experience seizures while at his home and assumed she was taking medication to control the problem.

In 2006, Thompson said, he purchased a home in the Bahamas where Smith went to live. He and Stern remain embroiled in litigation over the property known as Horizons. Smith claimed it was a gift to her, which Thompson denies.

Smith was pregnant, and when her daughter was born in September of that year, Thompson said, Smith asked him to put his name on the birth certificate as father of the child.

“I contemplated it but it was not the right thing to do,” he said. “I knew I was not the father. I had had a vasectomy.”

He also recalled Stern asking him to watch over a bag containing Smith’s medications.

“He said we had to keep the bag away from her because she could hurt herself,” the witness recalled.

On cross-examination, Stern’s lawyer, Steve Sadow, asked Thompson if he ever saw Smith exhibit drug cravings or drug-seeking behavior. He said he did not.